#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N=19001;
int n,m,a[N];
vector<int> v;
signed main()
{
	freopen("rotate.in","r",stdin);
	freopen("rotate.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n;
	for(int i=1;i<=n;i++)	cin>>a[i];
	for(int i=1;i<n;i++)
		for(int j=1;j<=n-i;j++)
			if(a[j]>a[j+1])
			{
				m++;
				v.push_back(j);
				swap(a[j],a[j+1]);
			}
	cout<<2<<' '<<m<<'\n';
	for(auto i:v)	cout<<1<<' '<<i<<'\n';
	return 0;
}
